﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Ozner.BLL;
using Ozner.Common;
using Ozner.Model;
using DevExpress.Skins;
namespace Ozner.UI
{
    public partial class FrmIndexInfomation : FrmBaseDev
    {
        private IndexInfomationBLL indexBLL = new IndexInfomationBLL();
        public FrmIndexInfomation()
        {
            InitializeComponent();
            this.Load += FrmIndexInfomation_Load;

        }

        private void FrmIndexInfomation_Load(object sender, EventArgs e)
        {
            ShowWaiting("正在查询用户信息...");
            BaseResult<User> br = indexBLL.GetLoginUser();
            if(br.Code == Code.OK)
            {
                lblAccount.Text = br.Object.Account;
                lblName.Text = br.Object.Name;
            }
            UpdateCaption("正在查询系统公告...");
            BaseResult<JsonBaseResult<SystemNotice>> br2 = indexBLL.GetSystemNotice();
            if (br2.Code == Code.OK)
            {
                gridSystemNotice.DataSource = br2.Object.Rows;
            }
            CloseWaiting();
        }
    }
}